import 'package:blog_flutter/controller/RightClassController.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class RightClassWidget extends StatelessWidget {

  RightClassController _rightClassController = Get.put(RightClassController());

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      margin: EdgeInsets.only(left: 20, right: 20, top: 20),
      padding: EdgeInsets.all(12),
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.all(Radius.circular(10))
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text("分类", style: TextStyle(fontWeight: FontWeight.w600),),
          ListView(
            shrinkWrap: true,
            children: [
              ...List.generate(_rightClassController.classList.length, (index) => ListTile(title: Text(_rightClassController.classList[index])))
            ],
          )
        ],
      ),
    );
  }
}
